<template>
  <div>
    <el-aside width="300px">
      <!-- 头像 -->
      <div class="header">
        <div class="img">
          <img src="../../assets/images/头像 男孩.png" alt="" />
        </div>
        <div>{{ titleData.username }}</div>
        <a href="javascript:;"
          ><i class="el-icon-location-information"></i> {{ titleData.a }}</a
        >
      </div>
      <!-- 分割线 -->
      <div class="line"></div>

      <!-- 导航 -->
      <el-menu
        default-active="2"
        class="el-menu-vertical-demo"
        text-color="#fff"
        active-text-color="#2dbcbe"
        unique-opened
        router
      >
        <!-- 一级菜单 -->
        <el-submenu
          :index="item.subId"
          ref="submenuRef"
          v-for="item in menuData"
          :key="item.subId"
        >
          <template slot="title">
            <i :class="item.icon"></i>
            <span>{{ item.submenuName }}</span>
          </template>
          <!-- 二级菜单 -->
          <el-menu-item-group>
            <el-menu-item
              :index="item1.url"
              v-for="item1 in item.children"
              :key="item1.menuItemId"
              >{{ item1.menuItemName }}</el-menu-item
            >
          </el-menu-item-group>
        </el-submenu>
      </el-menu>
    </el-aside>
  </div>
</template>
<script>
import "./menu_item.css";
export default {
  props: ["menuData", "titleData"],
  data() {
    return {};
  },
};
</script>
<style lang="scss" scoped>
@import "./menu_item.css";
.el-aside {
  background-color: #2dbcbe;
  height: 100%;

  text-align: center;
  color: #ffffff;
  .header {
    margin: 30px 0;
    // display: flex;
    // // align-items: center;
    // justify-content: center;
    :nth-child(2) {
      // color: #fff;
      font-size: 18px;
      margin-bottom: 10px;
    }
  }

  a {
  }
  .img {
    img {
      height: 100px;
      width: 100px;
      border-radius: 50%;
    }
  }
}
.el-menu {
  background-color: #2dbcbe !important;
  margin-top: 10px;
  // margin-right: -1px;
  width: 300px;
}
.el-submenu {
  text-align: left;
  // margin-right: -1px;
  // padding-left: 30px;
}
i {
  color: #fff;
}
</style>